package com.taoyeshu.modules.sys.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import com.taoyeshu.common.persistence.CrudMapper;
import com.taoyeshu.modules.sys.entity.User;
import com.taoyeshu.modules.sys.query.UserQuery;

@Repository
public interface UserMapper extends CrudMapper<User, Integer> {

	User queryByUsername(@Param("name") String username);

	List<User> findList(@Param("qo") UserQuery userQuery, @Param("first") int first, @Param("max") int max);

	int findCount(@Param("qo") UserQuery userQuery);

	void removeUR(@Param("userId") Integer userId);

	void saveUR(@Param("userId") Integer userId, @Param("roleId") Integer roleId);

}
